home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
fpkpas92.zip
/
SRCRTL.ZIP
/
RTL
/
DOS
/
SYSTEMH.INC
< prev
next >
Wrap
Text File
|
1997-07-01
|
10KB
|
284 lines
{****************************************************************************
Copyright (c) 1993,1997 by
Florian Klämpfl & Michael Spiegel
****************************************************************************}
{ diese Datei enthaelt die betriebssystemunabhaengigen Deklarationen der }
{ Unit System }
type
shortint = -128..127;
{ longint ist in TP als -2147483648..2147483647 deklariert, }
{ aber dies kann in dieser PP-Version nicht ueberstzt werden, }
{ werden, da der Compiler erst 2147483648 versucht in eine }
{ Int-Konstante umzuwandeln, um dann diese Zahl spaeter zu }
{ negieren, aber da macht VAL natürlich nicht mit }
{ also Zweierkomplementdarstellung: }
longint = $80000000..$7fffffff;
integer = -32768..32767;
byte = 0..255;
word = 0..65535;
const
{ max. Werte für longint und int }
maxlongint = $7fffffff;
maxint = 32767;
type
{ Turbo Pascal Fließkommatypen wenigstens deklarieren: }
double = real;
{$ifdef VER0_6}
extended = real;
single = real;
{$endif VER0_6}
{ Nullterminierte Strings }
pchar = ^char;
ppchar = ^pchar;
{$ifdef VER0_6}
fixed = longint;
{$endif}
const
{ Kompatibilität zu TP }
test8086 : byte = 2; { immer i386 oder neuer }
test8087 : byte = 3; { immer 387 oder höher; notfalls emuliert }
erroraddr : pointer = nil;
errorcode : word = 0;
{ max level in dumping on error }
max_frame_dump : word = 20;
var
{ Standartein- und ausgabe }
output,input : text;
exitproc : pointer;
inoutres : word;
var stackbottom : longint;
var loweststack : longint;
procedure runerror(w : word);
procedure move(var source,dest;count : longint);
procedure fillchar(var x;count : longint;value : char);
procedure fillchar(var x;count : longint;value : byte);
procedure fillword(var x;count : longint;value : word);
function lo(w : word) : byte;
function hi(w : word) : byte;
function lo(i : integer) : byte;
function hi(i : integer) : byte;
function lo(l : longint) : word;
function hi(l : longint) : word;
function ord(c : char) : byte;
function ord(b : boolean) : byte;
function chr(b : byte) : char;
function length(s : string) : byte;
procedure str(l : longint;var s : string);
procedure str(d : double;var s : string);
procedure str(i : integer;var s : string);
procedure str(si : shortint;var s : string);
procedure str(b : byte;var s : string);
procedure str(w : word;var s : string);
procedure val(const s : string;var v : longint;var code : word);
procedure val(const s : string;var v : longint);
procedure val(const s : string;var b : byte);
procedure val(const s : string;var b : byte;var code : word);
procedure val(const s : string;var d : double;var code : word);
procedure inc(var i : longint);
procedure inc(var i : integer);
procedure inc(var i : word);
procedure inc(var i : shortint);
procedure inc(var i : byte);
procedure dec(var i : longint);
procedure dec(var i : integer);
procedure dec(var i : word);
procedure dec(var i : shortint);
procedure dec(var i : byte);
procedure dec(var i : longint;a : longint);
procedure inc(var i : longint;a : longint);
procedure dec(var i : word;a : longint);
procedure inc(var i : word;a : longint);
procedure dec(var i : integer;a : longint);
procedure inc(var i : integer;a : longint);
procedure dec(var i : byte;a : longint);
procedure inc(var i : byte;a : longint);
procedure dec(var i : shortint;a : longint);
procedure inc(var i : shortint;a : longint);
function random(l : longint) : longint;
procedure halt;
procedure halt(errnum : byte);
procedure randomize;
function paramcount : longint;
function paramstr(l : longint) : string;
{ Speicherverwaltung }
procedure getmem(var p : pointer;size : longint);
procedure freemem(var p : pointer;size : longint);
function memavail : longint;
function maxavail : longint;
{ Dateiverwaltung }
procedure assign(var f : file;const name : string);
procedure rewrite(var f : file;l : word);
procedure rewrite(var f : file);
procedure reset(var f : file;l : word);
procedure reset(var f : file);
{$IfDef typedfile }
procedure assign(var f : typedfile;const name : string);
procedure rewrite(var f : typedfile);
procedure reset(var f : typedfile);
{ procedure close(var f : typedfile);
function filepos(var f : typedfile) : longint;
function filesize(var f : typedfile) : longint;
procedure seek(var f : typedfile;pos : longint);
procedure erase(var f : typedfile);
procedure rename(var f : typedfile;const s : string);
function eof(var f : typedfile) : boolean;}
{$endIf typedfile }
procedure append(var t : text);
procedure blockwrite(var f : file;var buf;count : longint);
procedure blockread(var f : file;var buf;count : longint);
procedure blockread(var f : file;var buf;count : longint;var result : longint);
procedure blockread(var f : file;var buf;count : word;var result : word);
{$IfDef GO32V2}
type
trealregs=record
realedi,realesi,realebp,realres,
realebx,realedx,realecx,realeax : longint;
realflags,
reales,realds,realfs,realgs,
realip,realcs,realsp,realss : word;
end;
{$PACKRECORDS 1}
t_go32_info_block = record
size_of_this_structure_in_bytes : longint; {offset 0}
linear_address_of_primary_screen : longint; {offset 4}
linear_address_of_secondary_screen : longint; {offset 8}
linear_address_of_transfer_buffer : longint; {offset 12}
size_of_transfer_buffer : longint; {offset 16}
pid : longint; {offset 20}
master_interrupt_controller_base : byte; {offset 24}
slave_interrupt_controller_base : byte; {offset 25}
selector_for_linear_memory : word; {offset 26}
linear_address_of_stub_info_structure : longint; {offset 28}
linear_address_of_original_psp : longint; {offset 32}
run_mode : word; {offset 36}
run_mode_info : word; {offset 38}
end;
t_stub_info = record
magic : array[0..15] of char;
size : longint;
minstack : longint;
memory_handle : longint;
initial_size : longint;
minkeep : word;
ds_selector : word;
ds_segment : word;
psp_selector : word;
cs_selector : word;
env_size : word;
basename : array[0..7] of char;
argv0 : array [0..15] of char;
dpmi_server : array [0..15] of char;
end;
p_stub_info = ^t_stub_info;
var go32_info_block : t_go32_info_block;
dos_argv0 : pchar;
const stub_info : p_stub_info = nil;
environ : ppchar = nil;
function heapsize : longint;
procedure doswrite(h,addr,len : longint);
function dosread(h,addr,len : longint) : longint;
procedure syscopyfromdos(addr : longint; len : longint);
procedure syscopytodos(addr : longint; len : longint);
function tb : longint;
procedure sysrealintr(intnr : word;var regs : trealregs);
{$EndIf GO32V2}
procedure close(var f : file);
function filepos(var f : file) : longint;
function filesize(var f : file) : longint;
procedure seek(var f : file;pos : longint);
procedure erase(var f : file);
procedure rename(var f : file;const s : string);
function eof(var f : file) : boolean;
procedure assign(var t : text;const s : string);
procedure rewrite(var t : text);
procedure reset(var t : text);
procedure close(var t : text);
function eof(var t : text) : boolean;
function eof : boolean;
function eoln(var t : text) : boolean;
function eoln : boolean;
procedure flush(var t : text);
procedure erase(var t : text);
procedure rename(var t : text;const s : string);
function ioresult : word;
procedure chdir(const s : string);
procedure mkdir(const s : string);
procedure rmdir(const s : string);
procedure getdir(drivenr : byte;var dir : string);
{ mathe routines }
function abs(l : longint) : longint;
function sqr(l : longint) : longint;
function odd(l : longint) : boolean;
function ptr(sel,off : word) : pointer;
{ float mathe routines }
{$I MATHH.INC}
{ string handling}
function copy(const s : string;index : integer;count : byte) : string;
procedure delete(var s : string;index : integer;count : integer);
procedure insert(const source : string;var s : string;index : integer);
function pos(const substr : string;const s : string) : byte;
function upcase(c : char) : char;
function upcase(const s : string) : string;
function lowercase(c : char) : char;
function lowercase(const s : string) : string;
function space(b : byte) : string;
function hexstr(val : longint;cnt : byte) : string;
function binstr(val : longint;cnt : byte) : string;
const
fmclosed = $D7B0;
fminput = $D7B1;
fmoutput = $D7B2;
fminout = $D7B3;
fmappend = $D7B4;
filemode : byte = 2;
{ old version doesn't like this }
{$ifdef dummy}
{$ifndef VER0_6_5}
{$ifndef VER0_6_4}
type
tobject = class
constructor create;
destructor free;virtual;
end;
{$endif}
{$endif}
{$endif}